﻿<UserControl
  x:Class="uhul.Controls.AppMenu"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:sys="clr-namespace:System;assembly=mscorlib"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:tkt="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
  xmlns:app="clr-namespace:uhul"
  xmlns:ctls="clr-namespace:uhul.Controls"
	mc:Ignorable="d"
	d:DesignWidth="600" d:DesignHeight="600"
>
  <UserControl.Resources>

    <app:AvailableApplications x:Key="AvailableApplications" >
      <app:AppInfo 
        Name="tlacitko"
        Description="logo UHULu"
        XapUri="SilverlightApplication1.xap"
        AssemblyName="SilverlightApplication1.dll"
        UserControlName = "SilverlightApplication1.SilverlightControl1"
        Icon="http://www.studenec.cz/sz/wp-content/uploads/archiv/foto/043_01vetev.jpg"
        ProviderIcon="http://www.lesypraha.cz/weiimages/sev_ruzne/logo_uhul_barva.jpg"
        AppType="Report"
        ThemeColor="#FFff6060"
      >
        <app:AppInfo.WebServiceEntryPoints>
          <sys:String x:Key="VyberLhcMapa_wsHospodarskaKniha">http://localhost:2000/ServiceHK.svc</sys:String>
          <sys:String x:Key="VyberLhcMapa_wsMap">http://localhost:8081/ServiceMap.svc</sys:String>
        </app:AppInfo.WebServiceEntryPoints>
      </app:AppInfo>
      
      <app:AppInfo
        Name="DD demo"
        Description="demo na drag and drop"
        XapUri="DemoDragDropManager.xap"
        AssemblyName="DemoDragDropManager.dll"
        UserControlName = "DemoDragDropManager.Page"
        Icon="http://www.skandinavskydum.cz/files/obrazky/strom.jpg"
        AppType="Report"
        ProviderIcon="http://www.intergraph.com/global/cz/images/ICSRomania.jpg"
        ThemeColor="#FF81E46D"
        MenuVisible="Visible"
      />
      <app:AppInfo 
        Name="kolecko"
        Description="letajici kolecko"
        XapUri="SilverlightApplication1.xap"
        AssemblyName="SilverlightApplication1.dll"
        UserControlName = "SilverlightApplication1.Control1"
        Icon="http://www.wallpaper.cz/primo/ir2/jedlovasiska--400x300.jpg"
        AppType="Report"
        ThemeColor="#FF702020"
        MenuVisible="Visible"
      />
      <app:AppInfo 
        Name="Aplikace obdelnicek"
        Description="aplikace zobrazuje letajici obdelnicek, je to jen demonstrace jak se aplikace chovaji v XapExploreru"
        XapUri="SilverlightApplication1.xap"
        AssemblyName="SilverlightApplication1.dll"
        UserControlName = "SilverlightApplication1.Control2"
        Icon="http://www.lesycr.cz/common/images/photo_gallery/myslivost-savci-jelen-evropsky/thumb/30-jelen.jpg"
        ProviderIcon="http://www.cingl.eu/userFiles/logos/cuzk.png"
        AppType="Report"
        ThemeColor="#FF816DE4"
      />

      <app:AppInfo 
        Name="tlacitko1"
        Description="logo UHULu"
        XapUri="SilverlightApplication1.xap"
        AssemblyName="SilverlightApplication1.dll"
        UserControlName = "SilverlightApplication1.SilverlightControl1"
        Icon="http://www.studenec.cz/sz/wp-content/uploads/archiv/foto/043_01vetev.jpg"
        ProviderIcon="http://www.lesypraha.cz/weiimages/sev_ruzne/logo_uhul_barva.jpg"
        AppType="Report"
        ThemeColor="#FF60ff60"
      />
      <app:AppInfo 
        Name="tlacitko2"
        Description="logo UHULu"
        XapUri="SilverlightApplication1.xap"
        AssemblyName="SilverlightApplication1.dll"
        UserControlName = "SilverlightApplication1.SilverlightControl1"
        Icon="http://www.studenec.cz/sz/wp-content/uploads/archiv/foto/043_01vetev.jpg"
        ProviderIcon="http://www.lesypraha.cz/weiimages/sev_ruzne/logo_uhul_barva.jpg"
        AppType="Report"
        ThemeColor="#FFffff60"
      />
    </app:AvailableApplications>

    <DataTemplate x:Key="VizitkaAplikace">
      <ctls:AppVCard
        VerticalAlignment="Top"
        AppInfo="{Binding .}"
        Click="RunApp"
        Visibility="{Binding MenuVisible}"
        Background="{Binding ThemeColor}"
      >
        <!--AppIcon="{Binding Icon}"
        AppName="{Binding Name}"
        AppDescription="{Binding Description}"-->
      </ctls:AppVCard>
    </DataTemplate>



    <ItemsPanelTemplate x:Key="PanelVizitekAplikaci">
      <tkt:WrapPanel 
        Orientation="Horizontal" Margin="0"
			/>
    </ItemsPanelTemplate>

  </UserControl.Resources>
  
  <Grid Background="#ffffffff">
    
    <ScrollViewer
			HorizontalScrollBarVisibility="Disabled" 
			VerticalScrollBarVisibility="Auto"
		>
      <Grid x:Name="MenuPanel" Background="White" ShowGridLines="False">
      <Grid.RowDefinitions>
        <RowDefinition Height="*" MaxHeight="40" MinHeight="40"/>
          <RowDefinition Height="*" MinHeight="150"/>
          <RowDefinition Height="*" MaxHeight="30"/>
      </Grid.RowDefinitions>
	
      <Grid.ColumnDefinitions>
          <ColumnDefinition Width="*" MaxWidth="30"/>
          <ColumnDefinition Width="*" MinWidth="265"/>
				  <ColumnDefinition Width="*" MaxWidth="30"/>
      </Grid.ColumnDefinitions>


			  <!--<tkt:WrapPanel Orientation="Horizontal">
        
          <ctls:AppVCard x:Name="t1" Nadpis="MYSL 01" Popis="Aplikace pro prohlizeni zakonnych vykazu MYSL01" AdresaObrazku="/uhul;component/30-jelen.jpg"/>
          <ctls:AppVCard x:Name="t2" Nadpis="Najdi Jprl" Popis="Vyhledani porostni skupiny"/>

        </tkt:WrapPanel>-->

        <!--
        zde se automaticky vkladaji vizitky aplikaci
        ItemsControl je prvek, ktery zajisti databinding
        na ObservableCollection of AppInfo a ridi jejich zobrazeni v prvku ScrollViewer
        -->
        <ItemsControl Margin="0"
          Grid.Column="1" Grid.Row="1"
          HorizontalAlignment="Left"
				  ItemTemplate="{StaticResource VizitkaAplikace}"
				  ItemsPanel="{StaticResource PanelVizitekAplikaci}"
          ItemsSource="{Binding Source={StaticResource AvailableApplications}}"
        />

        <!--
        ItemsSource="{Binding XapExplorer.AvilableApplications}"
        ItemTemplate="{StaticResource ZalozkaAplikace}"
        ItemsPanel="{StaticResource PanelZalozekAplikaci}"
        -->
				

      </Grid>
    </ScrollViewer>
    
  </Grid>
</UserControl>